using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace My.IdlConverter.Core.Filters
{
    public class MethodModifier
    {
        public static string WrapMethodRegex = @"virtual.*Wrap.*";
        public static string InitMethodRegex = @"virtual.*Init.*";
        public static string[] ExcludeMethods = 
            {
                "SetBaseMasterLeft",
                "SetBaseMasterRight",
                "GetObjectFromID",
                "CreateObject",
                "Attach",
                "GetWindowHandle"
            };

        public static bool IsAspiredMethod(string methodEntry)
        {
            if (Regex.IsMatch(methodEntry, WrapMethodRegex))
                return false;
            if (Regex.IsMatch(methodEntry, InitMethodRegex))
                return false;
            foreach (string nextExcludeMethod in ExcludeMethods)
            {
                if (methodEntry.IndexOf(nextExcludeMethod) != -1)
                    return false;
            }
            return true;
        }
    }
}
